

#include "system.h"
#include "SysTick.h"
#include "led.h"

extern uint16_t Flag_T_500ms;
extern Flag_structInit Flag;

int main()
{
//	SysTick_Init(72);
	uint16_t cnt = 0;
	SysTick_Config(SystemCoreClock/1000);//  72mhz/1000   1ms
	LED_Init();
	while(1)
	{	
		if(Flag.T_500ms == 1)
		{
			if(cnt < 0xfff0) cnt++;
			else cnt = 0;
			
			Flag.T_500ms = 0;
			
			if(cnt%2 == 1)
			{
				led1=0;
				led2=0;
			}
			else
			{
				led1=1;
				led2=1;
			}
		}
		if(Flag.T_1ms)
		{
			Flag.T_1ms = 0;
		}
		if(Flag.T_10ms)
		{
			Flag.T_10ms = 0;
		}
	}
}
